<?php
//接收到异步发送过来的用户名
$username = $_POST['u'];
$data = include './data.php';
foreach ($data as $u){
    //如果用户名已存在
    if($u['username'] == $username){
        //返回异步js
        echo 1;
        exit;
    }
}
//如果用户名不存在
echo 0;